module(..., package.seeall)
NODE = {
_fds=[[
_fds={0.1, proto="concat", activate="lua"}
_dfs={0.11, proto="concat", activate="lua"}
_hkt={0.12, proto="concat", activate="lua"}
_pto={0.2}
_ins={0.22}
_abs={0.23}
_cds={0.3, proto="concat", activate="lua"}
_cfd={0.31, proto="concat", activate="lua"}
_cad={0.32,proto="concat",activate="lua"}
_cmc={0.4}
_act={0.6, proto="abstract", activate="lua"}
_acl={0.7, proto="abstract"}
_doc={0.8, proto="concat", activate="lua"}

title           = {0.1}
category        = {1.2}
config          = {1.4, proto="concat", activate="lua"}
markup_module   = {1.41, proto="fallback"}
templates       = {1.5, proto="concat", activate="list"}
translations    = {1.51, proto="concat", activate="list"}
owners          = {1.71}
templates       = {1.5, proto="concat", activate="list"}
translations    = {1.51, proto="concat", activate="list"}

html_main       = {1.701, proto="fallback"}
html_head       = {1.702, proto="fallback"}
html_menu       = {1.703, proto="fallback"}
html_logo       = {1.704, proto="fallback"}
html_search     = {1.705, proto="fallback"}
html_page       = {1.706, proto="fallback"}
html_content    = {1.7061, proto="fallback"}
html_body       = {1.707, proto="fallback"}
html_header     = {1.708, proto="fallback"}
html_footer     = {1.708, proto="fallback"}
html_sidebar    = {1.709, proto="fallback"}
html_meta_keywords = {1.70901, proto="fallback"}
html_meta_description = {1.70902, proto="fallback"}
redirect_destination =  {1.70903}
xssfilter_allowed_tags = {1.7091, proto="concat", activate="lua"}
http_cache_control = {1.710, proto="fallback"}
http_expires    = {1.711, proto="fallback"}

content={1.8}

edit_ui         = {1.9, proto="concat"}
admin_edit_ui   = {1.91, proto="concat"}
child_defaults  = {1.92, proto="concat", activate="lua"}
icon            = {1.93, proto="fallback"}
breadcrumb      = {1.94 }
save_hook       = {1.95, proto="fallback"}
raw_content_type = {1.96}
template_helpers = {1.97, activate="lua", proto="concat"}

]],

title="@Root (Root Prototype)",
category="Prototypes",
markup_module = "markdown",
templates     = "@ws/@templates",
translations  = "@ws/@translations",
}

NODE._act=[===[
apidoc={act='zwsapi/actions/util.actions:apidoc'}
show={act='zwsapi/actions/util.actions:show'}
show_content={act='zwsapi/actions/util.actions:show_content'}
save={act='zwsapi/actions/util.actions:save'}
create={act='zwsapi/actions/util.actions:create'}
post={act='zwsapi/actions/util.actions:post'}
edit={act='zwsapi/actions/util.actions:edit'}
edit_new={act='zwsapi/actions/util.actions:edit_new'}
preview={act='zwsapi/actions/util.actions:preview'}
preview_content={act='zwsapi/actions/util.actions:preview_content'}
configure={act='zwsapi/actions/util.actions:configure'}
code={act='zwsapi/actions/util.actions:code'}
raw={act='zwsapi/actions/util.actions:raw'}
raw_content={act='zwsapi/actions/util.actions:raw_content'}
login={act='zwsapi/rootact.actions:show_login_form'}
cancel={act='zwsapi/actions/util.actions:cancel'}
reload={act='zwsapi/actions/util.actions:reload'}
]===]

NODE._acl=[[
deny(all_users, all_actions)
allow(Authenticated, show)  -- show, show_content, cancel
allow(Authenticated, edit_and_save) -- edit, save, preview
allow(Authenticated, "edit_new") -- edit, save, preview
allow(Authenticated, "create") -- edit, save, preview
allow(Authenticated, "post")  --needed for login
allow(all_users, "login")
--deny(Anonymous, edit_and_save)
allow(Admin, "reload")
allow(Admin, "configure")
allow(Admin, "raw")

allow(Admin,all_actions)
]]

NODE.edit_ui = [[
-------------------------- basic fields ----------------
content_section  = {1.0, "div_start", id="content_section", open="true"}
 content         = {1.3, "textarea", rows=15, no_label=true}
 content.editor_modules = {
                      "resizeable",
                      "markitup",
 }
content_section_end = {1.4, "div_end"}

-------------------------- advanced fields -------------
advanced_section = {2.0, "div_start", id="advanced"}
 page_name       = {2.21, "readonly_text"}
 title           = {2.22, "text_field"}
 owners          = {2.221, "text_field"}
 breadcrumb      = {2.23, "text_field"}
 category        = {2.24, "select", options = {}}
 _pto       = {2.25, "hidden", no_label=true, div_class="hidden"}
advanced_section_end = {2.3, "div_end"}

--- info about the edit --------------------------------
edit_info_section  = {3.00, "div_start", id="edit_info_section", open="true"} 
 summary         = {3.2, "textarea", no_label=true, rows=2, editor_modules = {"resizeable"}}
edit_info_section_end = {3.3, "div_end"}
]]

NODE.admin_edit_ui = [[
-------------------------- basic fields ----------------
--page_params_hdr = {1.0, "header"}
content_section  = {1.00, "div_start", id="content_section", open="true"}
 page_name       = {1.1, "readonly_text"}
 title           = {1.2, "text_field"}
 breadcrumb      = {1.3, "text_field"}
 content         = {1.4, "textarea", editor_modules = {"resizeable"}, rows=15, no_label=true}
content_section_end = {1.5, "div_end"}

-------------------------- advanced fields -------------
advanced_section = {2.0, "div_start", id="advanced_section"}
 category        = {2.01, "select", options = {"Foo", "Bar"}}
 _pto       = {2.02, "text_field"}
 redirect_destination = {2.022, "text_field"}
 _acl     = {2.03, "textarea", rows=3, editor_modules = {"resizeable", "validatelua"}}
 _act         = {2.04, "textarea", rows=3, editor_modules = {"resizeable", "validatelua"}}
 config          = {2.05, "textarea", rows=3, editor_modules = {"resizeable", "validatelua"}}
 markup_module   = {2.0501, "text_field"}
 html_meta_keywords = {2.051, "text_field"}
 html_meta_description = {2.052, "text_field"}
 save_hook       = {2.053, "text_field"}
advanced_section_end = {2.06, "div_end"}

html_section     = {2.100, "div_start", id="html_section", state="open"}
 html_main       = {2.101, "textarea", rows=3, editor_modules = {"resizeable"}}
 html_head       = {2.102, "textarea", rows=3, editor_modules = {"resizeable"}}
 html_body       = {2.103, "textarea", rows=3, editor_modules = {"resizeable"}}
 html_header     = {2.104, "textarea", rows=3, editor_modules = {"resizeable"}}
 html_menu       = {2.105, "textarea", rows=3, editor_modules = {"resizeable"}}
 html_logo       = {2.106, "textarea", rows=3, editor_modules = {"resizeable"}}
 html_page       = {2.108, "textarea", rows=3, editor_modules = {"resizeable"}}
 html_content    = {2.108, "textarea", rows=3, editor_modules = {"resizeable"}}
 html_sidebar    = {2.109, "textarea", rows=3, editor_modules = {"resizeable"}}
 html_footer     = {2.110, "textarea", rows=3, editor_modules = {"resizeable"}}
 xssfilter_allowed_tags = {2.111, "textarea", rows=3, editor_modules = {"resizeable"}}
html_section_end = {2.112, "div_end"}

http_section     = {2.201, "div_start", id="http_section", state="open"}
 http_cache_control = {2.202, "textarea", rows=3, editor_modules = {"resizeable"}}
 http_expires    = {2.203, "textarea", rows=3, editor_modules = {"resizeable"}}
http_section_end = {2.209, "div_end"}

guru_section     = {2.30, "div_start", id="guru_section"}
 templates       = {2.31, "text_field"}
 translations    = {2.32, "text_field"}
 _fds          = {2.33, "textarea", rows=3, editor_modules = {"resizeable", "validatelua"}}
 _dfs          = {2.331, "textarea", rows=3, editor_modules = {"resizeable", "validatelua"}}
 edit_ui         = {2.34, "textarea", rows=3, editor_modules = {"resizeable", "validatelua"}}
 admin_edit_ui   = {2.35, "textarea", rows=3, editor_modules = {"resizeable", "validatelua"}}
guru_section_end = {2.36, "div_end"}

--- info about the edit --------------------------------
edit_info_section  = {3.00, "div_start", id="edit_info_section", open="true"} 
 summary         = {3.2, "textarea", rows=3, editor_modules = {"resizeable"}}
edit_info_section_end = {3.3, "div_end"}
]]
content=[===[
root page
]===]
NODE.html_main=[==[
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		$head
	</head>
	<body>
		$body
		<script type="text/javascript" src="$js_base_url{}@ws/scripts.js"></script>
		$do_javascript_links[[<script type="text/javascript" src="$href"></script>]]
		$do_javascript_snippets[=[<script type="text/javascript">/* <![CDATA[ */ $snippet /* ]]> */</script>]=]
	</body>
</html>
]==]

NODE.html_head=[=[
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="keywords" content="$html_meta_keywords"/>
<meta name="description" content="$html_meta_description"/>
<title>$site_title: $title</title>
<link type="text/css" rel="stylesheet" href="$css_base_url{}@ws/style.css" media="all"/>
$do_css_links[[<link type="text/css" rel="stylesheet" href="$href" media="$media"/>]]
$do_css_snippets[[<style type="text/css" media="$media">$snippet</style>]]
<link rel="shortcut icon" href="$favicon_url"/>
<link rel="alternate" type="application/rss+xml" title="_(RECENT_EDITS_TO_SITE)" $site_rss_link/>
<link rel="alternate" type="application/rss+xml" title="_(RECENT_EDITS_TO_NODE)" $node_rss_link/>
$if_no_index[[<meta name="ROBOTS" content="NOINDEX, NOFOLLOW"/>]]
]=]

NODE.html_menu=[==[
<ul id='menu' class="level1">
	$do_nav_sections[=[
		<li class='$class level1' id='menu_item_$id'>
			<a title="$accessibility_title" $link>$title</a>
			<ul class='$class level2'>
				$subsections[[<li class='$class level2'><a title="$accessibility_title" $link>$title</a></li>]]
				<li style="display:none">&nbsp;</li>
			</ul>
		</li>
	]=]
</ul>
]==]

NODE.html_logo=[[
<a class="home_page" href="$home_page_url" title="Home page">
	<p class="site_title">$site_title</p>
	<p class="site_subtitle">$site_subtitle</p>
</a>
]]
NODE.html_logo = [==[
<a class="logo" href="$home_page_url">
<img src="$logo_url" alt="_(LOGO)" /> 
</a>
]==]
NODE.html_search = [==[
     <form action="$base_url" class="search">
      <input class="hidden" type="hidden" name="p" value="@ws/search"/>
      <input class="search_box" type="text" name="q" size="16"
             title="_(TOOLTIP_FOR_SEARCH_BOX)" value="$search_box_content"/>
      <input class="search_button" type="image" src="$icon_base_url{}icons/search.png" alt="_(BUTTON)"/>
     </form>
]==]
NODE.html_page=[=[
<div id="breadcrumbs">
	<ul>
		$do_breadcrumb[[<li class="first"><a $link>$title</a></li>]],[[<li class="follow"><a $link>▹&nbsp; $title</a></li>]]
	</ul>
<span class="toolbar">
	$do_toolbar[[$if_icon[====[<a $link title="$title"><img src="$icon_base_url{}$icon" alt="_(BUTTON)"/></a>]====]
		$if_text[====[<a $link>$title</a>]====]
	]]
       </span>
      </div>

<div class="title">$if_title_icon[[<img src="$title_icon" class="title_icon" alt="type icon ($title_icon)"/>]]
	<a name="title" title="_(CURRENT_PAGE)" $show_link >$title2</a> 
</div>
<div class="content">
	$do_messages[[<p class="$class">$message</p>]]
	<!-- start page content -->$content<!-- end page content -->
</div>
]=]

NODE.html_content   = [[Not used by default.
]]

NODE.html_body=[[
<div id='doc3' class='yui-t0'>
	<div id="login_form" class="popup_form" style="display: none"></div>
	<div id='hd'>
$header
	</div>
	<div id='bd'>
	<div id="yui-main">
	<div class="yui-b" id='page'>
$page
	</div>
	</div>
	<div class="yui-b" id="sidebar">
$sidebar
	</div>
	</div>  <!--#bd-->
	<div id='ft'>
$footer
	</div>
	</div> <!--#docN-->
<br/>
]]


NODE.html_header=[=[
<div id="login" style="vertical-align: middle;">
<!--login and search (in the upper right corner) -->
$if_search[[$search]]<br/><br/>
$if_logged_in[[<a>_(HI_USER)</a> , <a title="_(LOGOUT)" $logout_link>_(LOGOUT)</a>, <a title="_(CHGPWD)" $chgpwd_link>_(CHGPWD)</a>]]
$if_not_logged_in[[<a class="login_link" $login_link>_(LOGIN)</a> _(OR) <a $register_link>_(REGISTER)</a>]]

</div>
<div id="logo">
$logo
</div>
<div id="menu_bar">
$menu<!--br/><br/-->
</div>
]=]

NODE.html_sidebar=[==[
]==]

NODE.html_footer=[===[
<p>_(POWERED_BY_) | <a style="font-size: .7em" href="http://validator.w3.org/check?uri=referer">XHTML 1.1</a></p>
]===]

NODE.html_meta_keywords = " "
NODE.html_meta_description = " "
